<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/6/14 0014
  Time: 14:27下午
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<script>
    function check() {
        alert("==你真的点啊==")
    }
    function fun1() {
        //alert("==你圆润的走开了==")
        var xmlhttp;//一、获得浏览器对象
        if (window.XMLHttpRequest)
        {
            //  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
            xmlhttp=new XMLHttpRequest();
        }
        else
        {
            // IE6, IE5 浏览器执行代码
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
                document.getElementById("show").innerHTML=xmlhttp.responseText;
            }
        }
        xmlhttp.open("GET","http://localhost:8080/javaweb_shopping/ajaxservlet",true);
        xmlhttp.send();
    }
</script>
    <button onclick="check()">你点我下试试</button>

    用户名：<input type="text" name="uname" value="" onblur="fun1()">
    <span id="show"></span>
</body>
</html>
